package com.dhcc.sds.qzj.service.impl;

import com.dhcc.sds.qzj.entity.DrgsNewTemplate;
import com.dhcc.sds.qzj.service.IDrgsNewTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DrgsTemplateServiceImpl implements IDrgsNewTemplateService {
    @Autowired
    private List<MongoTemplate> mongoTemplates;
    @Override
    public List<DrgsNewTemplate> findByDiseaseType(String diseaseType) {
        Query query = new Query(Criteria.where("diseaseType").is(diseaseType));
        return mongoTemplates.get(0).find(query, DrgsNewTemplate.class);
    }
}
